<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<html>
<head>
    <title>Send message</title>
    <script type="text/javascript" src="/voteup/resources/js/jquery-1.6.1.js"></script>
    <script type="text/javascript" src="/voteup/resources/js/stylescript.js"></script>
</head>
<body>
<c:import url="/WEB-INF/jsp/header.jsp"/>
<c:import url="/WEB-INF/jsp/menu.jsp"/>
<c:if test="${not empty msg}">
    <p style="color: red">${msg}</p>
</c:if>
<h3>Send message</h3>
<form:form commandName="message" method="POST" action="/voteup/messages/sendnewmessage">
    <p class="toperson"> To person:<br><select name="to">
        <c:forEach items="${toperson}" var="person">
            <option value="${person.personId}" class="inputtext">${person}</option>
        </c:forEach>
    </select>
    </p>
    <p class="toperson">Title:<br><form:input path="title" cssClass="inputtext" size="50" maxlength="50"/><br></p>

    <p class="toperson">Message<br><form:textarea path="body" cols="50" cssClass="inputtext" rows="10"
                                                  maxlength="2000"/></p>
    <input type="submit" class="inputbutton" value="Send message"/>
</form:form>
</body>
</html>